<%@ Page Language="C#" MasterPageFile="~/Admin/Admin.Master" AutoEventWireup="true" CodeBehind="EditEvent.aspx.cs" Inherits="FreeLancer.HRB.WebApp.Admin.Pages.EditEvent" Title="<%$ Resources:labels, editEvent %>" %>
<%@ Register Assembly="DevExpress.Web.v8.1, Version=8.1.1.0, Culture=neutral, PublicKeyToken=49d90c14d24271b5"
  Namespace="DevExpress.Web.ASPxCallbackPanel" TagPrefix="dxcp" %>
<%@ Register Assembly="DevExpress.Web.v8.1, Version=8.1.1.0, Culture=neutral, PublicKeyToken=49d90c14d24271b5"
  Namespace="DevExpress.Web.ASPxRoundPanel" TagPrefix="dxrp" %>

<%@ Register Assembly="DevExpress.Web.ASPxEditors.v8.1, Version=8.1.1.0, Culture=neutral, PublicKeyToken=49d90c14d24271b5"
  Namespace="DevExpress.Web.ASPxEditors" TagPrefix="dxe" %>
<%@ Register Assembly="DevExpress.Web.v8.1, Version=8.1.1.0, Culture=neutral, PublicKeyToken=49d90c14d24271b5"
  Namespace="DevExpress.Web.ASPxUploadControl" TagPrefix="dxuc" %>
<%@ Register Assembly="DevExpress.Web.v8.1, Version=8.1.1.0, Culture=neutral, PublicKeyToken=49d90c14d24271b5"
  Namespace="DevExpress.Web.ASPxDataView" TagPrefix="dxdv" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
<script type="text/javascript" src="../../javascript/admin.js"></script>
  <div>
    <div style="margin-bottom: 10px;">
      <table>
        <%--<tr>
          <td style="width: 96px;"><span><%=Resources.labels.events %></span></td>
          <td>
            <asp:DropDownList runat="server" ID="cboEvents" Width="300px" 
              OnSelectedIndexChanged="cboEvents_SelectedIndexChanged" AutoPostBack="true">
            </asp:DropDownList>
            &nbsp;&nbsp;&nbsp;
          </td>
        </tr>--%>
        <tr>
          <td><span><%=Resources.labels.title %></span></td>
          <td>
            <asp:TextBox runat="server" ID="txtTitle" Width="300px"></asp:TextBox>
            <asp:RequiredFieldValidator ID="RequiredFieldValidator" runat="server" 
              ControlToValidate="txtTitle" Display="Dynamic" ErrorMessage="<%$ Resources:labels, titleReqMsg %>" />
            &nbsp;&nbsp;&nbsp;
          </td>
          <td><span><%=Resources.labels.language %></span></td>
          <td>
            <asp:DropDownList runat="server" ID="cboLanguage" Width="100px" 
              >
            </asp:DropDownList>
            &nbsp;&nbsp;&nbsp;
          </td>
          <td>
            <asp:Label runat="server" ID="lblUpdateAt"><%=Resources.labels.updateAt %></asp:Label>
            <asp:Label runat="server" ID="lblTime"></asp:Label>
          </td>
        </tr>
        <tr>
          <td colspan="2">
            <span><%=Resources.labels.content %></span><br />
            <asp:TextBox runat="server" ID="txtDescription" Width="400px" TextMode="multiLine" Rows="4" />
          </td>
          <td colspan="3" style="vertical-align:top;">
            <span><%=Resources.labels.settings %></span>
            <asp:CheckBox runat="Server" ID="chkIsPublished" Checked="true" Text="<%$ Resources:labels, approved %>" />
          </td>
        </tr>
      </table>      
    </div>
    <div>
      <dxdv:ASPxDataView ID="ASPxDataView" runat="server" RowPerPage="2" ColumnCount="5" 
        Width="1000px" ItemSpacing="2px" ItemStyle-Height="140px" OnCustomCallback="ASPxDataView_OnCustomCallback"
        ClientInstanceName="ciEvents_ASPxDataView">
        <ItemTemplate>
          <div>
            <dxe:ASPxImage ID="ASPxImageEvent" runat="server" Height="120px" Width="180px"
              ImageUrl='<%# "~/Images/EventImages/"+Eval("Path") %>'/>
            <br />
            <dxe:ASPxHyperLink ID="ASPxLinkDelete" runat="server" 
              Text="<%$ Resources:labels, cmdDelete %>" 
              NavigateUrl='<%# "javascript:Events_DeleteImage(" + Eval("ImageID") + ",\"" + Resources.labels.cmdConfirmDelete + "\")" %>'></dxe:ASPxHyperLink>
            <dxe:ASPxHyperLink ID="ASPxLinkEdit" runat="server" 
              Text="<%$ Resources:labels, cmdUpdate %>" 
              NavigateUrl='<%# "javascript:Events_UpdateImage(" + Eval("ImageID") + ")" %>'></dxe:ASPxHyperLink>
            <%--<dxe:ASPxImage ID="ASPxImageEvent" runat="server"></dxe:ASPxImage>--%>
          </div>
        </ItemTemplate>
      </dxdv:ASPxDataView>
    </div>
    <div>
      <dxcp:ASPxCallbackPanel ID="ASPxCallbackPanel" runat="server" Width="100%"
        ClientInstanceName="ciEvents_ASPxCallbackPanel" OnCallback="ASPxCallbackPanel_OnCallback">
        <PanelCollection>
          <dxrp:PanelContent runat="server">
            <table id="entrySettings">
              <%--<tr>
                <td class="label"><%=Resources.labels.slug %></td>
                <td>
                  <asp:TextBox runat="server" ID="txtSlug" Width="400px" />
                </td>
                <td>
                  <a href="#"><%=Resources.labels.extractFromTitle %></a>
                </td>
              </tr>--%>    
              <tr>
                <td class="label"><%=Resources.labels.imageTitle %></td>
                <td>
                  <%--<asp:TextBox runat="server" ID="txtImageTitle" Width="400px" />--%>
                  <dxe:ASPxTextBox ID="ASPxTextBoxImageTitle" ClientInstanceName="ciEvents_ASPxTextBoxImageTitle"
                    runat="server" Width="400px">
                  </dxe:ASPxTextBox>
                  
                </td>
              </tr>
              <tr  style="vertical-align:top;">
                <td class="label"><%=Resources.labels.description %></td>
                <td>
                  <%--<asp:TextBox runat="server" ID="txtImageDescription" Width="400" TextMode="multiLine" Columns="50" Rows="4" />--%>
                  <dxe:ASPxMemo ID="ASPxMemoImageDescription" runat="server" Height="130px" Width="400px"
                    ClientInstanceName="ciEvents_ASPxMemoImageDescription">
                  </dxe:ASPxMemo>
                </td>
                <td>
                  <dxe:ASPxImage ID="ASPxImage" runat="server" 
                    ClientInstanceName="ciEvents_ASPxImage" 
                    Height="120px" Width="165px">
                  </dxe:ASPxImage>
                </td>
              </tr>
              <tr>
                <td class="label"><%=Resources.labels.imageLink %></td>
                <td>
                  <%--<asp:TextBox runat="server" ID="txtImageLink" Width="400px" />--%>
                  <dxe:ASPxTextBox ID="ASPxTextBoxImageLink" ClientInstanceName="ciEvents_ASPxTextBoxImageLink"
                    runat="server" Width="400px" >
                  </dxe:ASPxTextBox>
                </td>
              </tr>
              <tr>
                <td>
                  <span><%=Resources.labels.descriptionImage %></span>
                </td>
                <td>
                  <table>
                    <tr>
                      <td>
                        <dxuc:ASPxUploadControl ID="ASPxUploadControl" runat="server"
                          OnFileUploadComplete="ASPxUploadControl_FileUploadComplete" 
                          ClientInstanceName="ciEvents_ASPxUploadControl" Width="50px">
                          <ValidationSettings AllowedContentTypes="image/jpeg,image/pjpeg,image/gif,image/png,image/x-png"
                            NotAllowedContentTypeErrorText="<%$ Resources:labels, notAllowedContentTypeErrorText %>" 
                            FileDoesNotExistErrorText="<%$ Resources:labels, fileDoesNotExistErrorText %>"
                            MaxFileSize="2000000"
                            MaxFileSizeErrorText="<%$ Resources:labels, maxFileSizeErrorText %>">
                          </ValidationSettings>
                          <ClientSideEvents FileUploadComplete="function(s,e) { ciEvents_ASPxUploadControl_FileUploadComplete(s,e); }"/>
                        </dxuc:ASPxUploadControl>
                      </td>
                      <td>
                        <dxe:ASPxButton ID="ASPxButtonUpload" runat="server" Text="<%$ Resources:labels, btnUploadText %>" AutoPostBack="false">
                          <ClientSideEvents Click="function(s,e) { ciEvents_ASPxButtonUpload_Click(s,e); }"/>
                        </dxe:ASPxButton>
                      </td>
                      <td>
                        <dxe:ASPxButton ID="ASPxButtonUpdate" runat="server" Text="<%$ Resources:labels, cmdUpdate %>" AutoPostBack="false"
                          OnClick="ASPxButtonUpdate_OnClick">
                            <ClientSideEvents Click="function(s,e) { ciEvents_ASPxButtonUpdate_Click(s,e); }"/>
                        </dxe:ASPxButton>
                      </td>
                      <td>
                        <dxe:ASPxButton ID="ASPxButtonClear" runat="server" Text="<%$ Resources:labels, cmdCancel %>" AutoPostBack="false">
                          <ClientSideEvents Click="function(s,e) { ciEvents_ASPxButtonClear_Click(s,e); }"/>
                        </dxe:ASPxButton>
                      </td>
                    </tr>
                  </table>
                </td>
                <td>
                  <dxe:ASPxTextBox ID="ASPxTextBoxImageName" runat="server" ClientInstanceName="ciEvents_ASPxTextBoxImageName" 
                    ReadOnly="true" Border-BorderStyle="None" BackColor="Transparent" ForeColor="#f1f1f1" Width="0px">
                  </dxe:ASPxTextBox>
                </td>
              </tr>
              <%--<tr>
                <td class="label"><%=Resources.labels.keywords %></td>
                <td><asp:TextBox runat="server" ID="txtKeyword" Width="400" /></td>
              </tr>--%>
              <%--<tr>
                <td class="label"><%=Resources.labels.settings %></td>
                <td><asp:CheckBox runat="Server" ID="chkIsPublished" Checked="true" Text="<%$ Resources:labels, approved %>" /></td>
              </tr>
              <tr>
                <td></td>
                <td><asp:CheckBox runat="Server" ID="chkIsCommentAllowed" Checked="true" Text="<%$ Resources:labels, isCommentAllowed %>" /></td>
              </tr>--%>
            </table>
          </dxrp:PanelContent>
        </PanelCollection>
      </dxcp:ASPxCallbackPanel>
        
      
      <div style="text-align:right">
        <asp:Label runat="server" ID="lblError"></asp:Label>
        <asp:Label runat="server" ID="lblInfo"></asp:Label>
        <asp:Button runat="server" ID="btnSave" Text="<%$ Resources:labels, cmdUpdate %>" OnClick="btnSave_Click"/>
        <asp:Button runat="server" ID="btnDelete" Text="<%$ Resources:labels, cmdDelete %>" OnClick="btnDelete_Click" 
          OnClientClick="<%$ Resources:labels, scriptConfirm %>"/>
      </div>
      <div style="text-align:right; color:Red; margin-top: 10px;">
        <asp:Label runat="server" ID="lblErrorUpdateFailed" Visible="false"
          Text="<%$ Resources:labels, infoUpdateFailed %>"></asp:Label>
        <asp:Label runat="server" ID="lblErrorLoadFailed" Visible="false"
          Text="<%$ Resources:labels, infoLoadFailed %>"></asp:Label>
        <asp:Label runat="server" ID="lblErrorDeleteFailed" Visible="false"
          Text="<%$ Resources:labels, infoDeleteFailed %>"></asp:Label>  
      </div>
    </div>
  </div>
</asp:Content>
